Crate random_word
source ·Expand description
random_word
The random_word
crate provides an efficient way to generate random
english words.
All words are compiled pre-sorted with the library, optimized for fast, zero allocation lookup.
Generating a random word
let word = random_word::gen();
Generating a random word starting with ‘c’
let word = random_word::gen_starts_with('c');
assert!(word.is_some())
Get all available words
let word_list = random_word::all();
Functions
- Returns an alphabetically ordered slice of 178,187 english words.
- Returns an alphabetically ordered slice of all words with the specified length.
- Returns an alphabetically ordered slice of all words with the specified length, and starting with the specified character
- Returns an alphabetically ordered slice of all words that begin with the specified character.
- Returns a reference to a randomly generated english word.
- Returns a reference to a word with the specified length.
- Returns a reference to a word with the specified length, and starting with the specified character.
- Returns a reference to a word that begins with the specified character.